﻿<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:mvvmLightCommand="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.SL4"
             xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:Rio_Framework_Pages_Controls="clr-namespace:Rio.Framework.Pages.Controls;assembly=Rio.Framework.Pages"
             x:Class="Rio.Manager.Application.Views.ListUndoCheckOutTabView"
             mc:Ignorable="d"
             d:DesignHeight="300"
             d:DesignWidth="400">


    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Rio.Manager.Application;component/Skins/ListUndoCheckOutTabSkin.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>

    <UserControl.DataContext>
        <Binding Path="ListUndoCheckOutTab"
                 Source="{StaticResource Locator}" />
    </UserControl.DataContext>

    <Grid x:Name="LayoutRoot">
        <i:Interaction.Triggers>
            <i:EventTrigger EventName="Loaded">
                <mvvmLightCommand:EventToCommand Command="{Binding InitializationCommand}" />
            </i:EventTrigger>
        </i:Interaction.Triggers>

        <StackPanel>
            <Rio_Framework_Pages_Controls:BindableOrganizationFolderTypePanel Mode="Admin"
                                                                              SelectedOrganization="{Binding SelectedOrganization, Mode=TwoWay}"
                                                                              SelectedFolderType="{Binding SelectedFolderType, Mode=TwoWay}"
                                                                              Margin="0"
                                                                              HorizontalAlignment="Center"
                                                                              OrganizationLabel="{Binding OrganizationLabel}"
                                                                              FolderTypeLabel="{Binding FolderTypeLabel}" />
            <telerik:RadToolBar BorderBrush="#FF646464"
                                BorderThickness="1"
                                Height="30"
                                Margin="0,20,0,0">
                <telerik:RadMenuItem Header="Supprimer"
                                     Command="{Binding RemoveSelectedUsersCommand}" />
            </telerik:RadToolBar>
            <telerik:RadGridView x:Name="radGridView"
                                 Margin="0"
                                 SelectionChanged="radGridView_SelectionChanged"
                                 SelectionUnit="FullRow"
                                 SelectionMode="Extended"
                                 ItemsSource="{Binding CheckOutUsers, Mode=TwoWay}"
                                 AutoGenerateColumns="False">
                <telerik:RadGridView.Columns>
                    <telerik:GridViewSelectColumn />
                    <telerik:GridViewDataColumn Header="ID"
                                                DataMemberBinding="{Binding VersionId}" />
                    <telerik:GridViewDataColumn Header="{Binding ListUndoCheckOutTab.UserHeaderLabel, Source={StaticResource Locator}, Mode=OneWay}"
                                                UniqueName="Users"
                                                DataMemberBinding="{Binding CreatedBy}" />
                    <telerik:GridViewDataColumn Header="{Binding ListUndoCheckOutTab.DocumentHeaderLabel, Source={StaticResource Locator}, Mode=OneWay}"
                                                DataMemberBinding="{Binding DocumentPath}" />
                    <telerik:GridViewDataColumn Header="{Binding ListUndoCheckOutTab.DateHeaderLabel, Source={StaticResource Locator}, Mode=OneWay}"
                                                DataMemberBinding="{Binding CreatedOn}" />
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>
        </StackPanel>

        <telerik:RadBusyIndicator IsBusy="{Binding BusyIndicator.IsBusy}"
                                  IsIndeterminate="True" />
    </Grid>
</UserControl>
